<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>后台管理模板</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no">
		<link rel="stylesheet" href="../../layui/css/layui.css" media="all" />
		<link rel="stylesheet" href="../../css/global.css" media="all">
		<link rel="stylesheet" type="text/css" href="http://www.jq22.com/jquery/font-awesome.4.6.0.css">
		<link rel="stylesheet" href="../../datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css">
		<style type="text/css">
		</style>
	</head>
	<body>
		<div class="layui-layout layui-layout-admin" style="border-bottom: solid 5px #1aa094;">
			<!--头部导航-->
			<div class="layui-header header header-demo" ></div>
			<!--左侧导航-->
			<div class="layui-side layui-bg-black" id="admin-side">
			</div>
			<!--右侧具体内容-->
			<div class="layui-body" style="bottom: 0;border-left: solid 2px #1AA094;padding:20px" id="admin-body">
				<div class="title">编辑个人资料</div>
				<hr/>
				<form class="layui-form" action="">
				<div class="layui-form-item">
					<img src="../../images/demo1.png" style="margin:20px 20px 20px 50px;width: 60px" id="edit_personUrl"><div class="layui-btn layui-btn-radius layui-btn-primary" style="margin:20px 10px">上传头像</div>
				</div>
					<div class="layui-form-item" style="margin-right: 800px">
						<label class="layui-form-label">编号</label>
						<div class="layui-input-block">
							<input type="text" name="edit_personId" required  lay-verify="required" placeholder="请输入编号" autocomplete="off" class="layui-input" >
						</div>
					</div>
					<div class="layui-form-item" style="margin-right: 800px">
						<label class="layui-form-label">姓名</label>
						<div class="layui-input-block">
							<input type="text" name="edit_personName" required  lay-verify="required" placeholder="请输入姓名" autocomplete="off" class="layui-input" >
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">单选框</label>
						<div class="layui-input-block">
							<input type="radio" name="edit_personSex" value="男" title="男">
							<input type="radio" name="edit_personSex" value="女" title="女" checked>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">类型</label>
						<div class="layui-input-block">
							<input type="radio" name="edit_personPower" value="smanager" title="超级管理员">
							<input type="radio" name="edit_personPower" value="cmanager" title="普通管理员" checked>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">原有密码</label>
						<div class="layui-input-inline">
							<input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
						</div>
						<div class="layui-form-mid layui-word-aux">填写正确信息方可完成信息修改</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">新密码</label>
						<div class="layui-input-inline">
							<input type="password" name="new-password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
						</div>
						<div class="layui-form-mid layui-word-aux">若不修改密码可不填</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">再次输入</label>
						<div class="layui-input-inline">
							<input type="password" name="re-password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
						</div>
						<div class="layui-form-mid layui-word-aux">若不修改密码可不填</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-input-block">
							<button class="layui-btn" lay-submit lay-filter="formDemo">确认修改</button>
							<button type="reset" class="layui-btn layui-btn-primary">重置</button>
						</div>
					</div>
				</form>
				
			</div>
			<!--底部导航-->
			<div class="layui-footer footer footer-demo" id="admin-footer"></div>
			<!--JS模块-->
			<script type="text/javascript" src="../../layui/layui.js"></script>
			<script src="../../js/jquery-1.12.3.min.js"></script>
			<script src="../../js/index.js"></script>
			<script src="../../layui/layui.js"></script>
			<script>
			layui.use('form', function() {
				var form = layui.form();
				var data = {
					"code": 200,
					"admin": {
						"adminId": 100124,
						"adminSex": "女",
						"adminName": "hwjlmn",
						"adminPower": 92252,
						"adminUrl": "../../images/6.jpg",
						"adminNickname": "hwjlmn"
					}
				}
				/*$.ajax({
					type: "get",
					url: "/randomdelivery/AdminController/Admin/"+data.admin.adminId,
					data: {},
					async: true,
					dateType: "json",
					contentType: "application/json",
					success: function(data) {*/

				editinfo(data)
					/*},
					Error: function() {
						alert("服务器出错");
					}
				})*/
				function editinfo(data) {
							$("#edit_personUrl").attr({
								"src": data.admin.adminUrl,
							});
							$("input[name='edit_personId']").val(data.admin.adminId)
							$("input[name='edit_personName']").val(data.admin.adminName)
							$("input[name='edit_personSex']").val(data.admin.adminSex)
							$("input[name='edit_personPower']").val(data.admin.adminPower)
				}
				//各种基于事件的操作，下面会有进一步介绍
			});
			</script>
		</div>
	</body>
</html>